import instance from "@/utils/request";

//获取角色列表
export function getCompanyApi(params){
    return instance({
        url:'/sys/role',
        method:'GET',
        params
    })
}

//根据ID获取角色详情
export function getRoleApi(id){
    return instance({
        url:`/sys/role/${id}`
    })
}


//根据ID更新角色
export function updateRoleApi(data){
    return instance({
        url:`/sys/role/${data.id}`,
        method:'PUT',
        data
    })
}

//添加角色
export function addRoleApi(data){
    return instance({
        url:'/sys/role',
        method:'POST',
        data
    })
}

//根据ID删除部门
export function delRoleApi(id){
    return instance({
        url:`/sys/role/${id}`,
        method:'DELETE'
    })
}

//获取企业信息
export function getCPApi(id){
    return instance({
        url:`/company/${id}`
    })
}